import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/home'
    },
    {
      path: '/login',
      component: resolve => require(['@/components/login.vue'], resolve),
      meta: { 
        title: '登录'
      },
    },
    {
      path: '/',
      component: resolve => require(['@/components/home.vue'], resolve),
      meta: { 
        title: '系统首页'
      },
      children:[
          {
            path: '/home',
            component: resolve => require(['@/components/page/index.vue'], resolve),
            meta: { 
              title: '系统首页'
            },
          },
          {
            path: '/userlist',
            component: resolve => require(['@/components/page/user/userlist.vue'], resolve),
            meta: { 
              title: '用户列表'
            },
          },
          {
            path: '/rolelist',
            component: resolve => require(['@/components/page/role/rolelist.vue'], resolve),
            meta: { 
              title: '角色管理'
            },
          },
          {
            path: '/rolelist/right_set/:id',
            component: resolve => require(['@/components/page/role/right_set.vue'], resolve),
            meta: { 
              title: '权限设置'
            },
          },
          {
            path: '/farmerlist',
            component: resolve => require(['@/components/page/user/farmerlist.vue'], resolve),
            meta: { 
              title: '养殖户列表'
            },
           
          },
          {
            path: '/sellerlist',
            component: resolve => require(['@/components/page/user/sellerlist.vue'], resolve),
            meta: { 
              title: '养殖户列表'
            },
           
          },
          {
            path: '/farmerlist/farmer_detail/:id',
            component: resolve => require(['@/components/page/user/details/farmer_detail.vue'], resolve),
            meta: { 
              title: '养殖户详情'
            },
          },
        
          {
            path: '/merchantlist',
            component: resolve => require(['@/components/page/user/merchantlist.vue'], resolve),
            meta: { 
              title: '商户列表'
            },
          },
          {
            path: '/merchantlist/merchant_detail/:id',
            component: resolve => require(['@/components/page/user/details/merchant_detail.vue'], resolve),
            meta: { 
              title: '商户详情'
            },
          },
          {
            path: '/qtlist',
            component: resolve => require(['@/components/page/user/qtlist.vue'], resolve),
            meta: { 
              title: '质检员列表'
            },
          },
          {
            path: '/qtlist/qt_detail/:id',
            component: resolve => require(['@/components/page/user/details/qt_detail.vue'], resolve),
            meta: { 
              title: '质检员详情'
            },
          },
          {
            path: '/deliverylist',
            component: resolve => require(['@/components/page/user/deliverylist.vue'], resolve),
            meta: { 
              title: '配送员列表'
            },
          },
          {
            path: '/deliverylist/delivery_detail/:id',
            component: resolve => require(['@/components/page/user/details/delivery_detail.vue'], resolve),
            meta: { 
              title: '配送员详情'
            },
          },
          {
            path: '/translist',
            component: resolve => require(['@/components/page/user/translist.vue'], resolve),
            meta: { 
              title: '运输员列表'
            },
          },
          {
            path: '/waybill_3',
            component: resolve => require(['@/components/page/waybill/waybill_3.vue'], resolve),
            meta: { 
              title: '已分配运单'
            },
          },
          {
            path: '/translist/trans_detail/:id',
            component: resolve => require(['@/components/page/user/details/trans_detail.vue'], resolve),
            meta: { 
              title: '运输员详情'
            },
          },
          {
            path: '/base',
            component: resolve => require(['@/components/page/base.vue'], resolve),
            meta: { 
              title: '养殖基地管理'
            },
          },
          {
            path: '/base/addbase',
            component: resolve => require(['@/components/page/addbase.vue'], resolve),
            meta: { 
              title: '新增养殖基地'
            },
          },
          {
            path: '/base/edit/:id',
            component: resolve => require(['@/components/page/addbase.vue'], resolve),
            meta: { 
              title: '编辑养殖基地'
            },
          },
          {
            path: '/base/detail/:id',
            component: resolve => require(['@/components/page/addbase.vue'], resolve),
            meta: { 
              title: '详情养殖基地'
            },
          },
          {
            path: '/site',
            component: resolve => require(['@/components/page/site.vue'], resolve),
            meta: { 
              title: '站点管理'
            },
          },
          {
            path: '/order_0',
            component: resolve => require(['@/components/page/order/order_0.vue'], resolve),
            meta: { 
              title: '待处理订单'
            },
          },
          {
            path: '/order_0/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '待处理订单详情'
            },
          },
          {
            path: '/order_1',
            component: resolve => require(['@/components/page/order/order_1.vue'], resolve),
            meta: { 
              title: '待发货订单'
            },
          },
          {
            path: '/order_1/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '待发货订单详情'
            },
          },
          {
            path: '/order_2',
            component: resolve => require(['@/components/page/order/order_2.vue'], resolve),
            meta: { 
              title: '待收货订单'
            },
          },
          {
            path: '/order_2/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '待收货订单详情'
            },
          },
          {
            path: '/order_3',
            component: resolve => require(['@/components/page/order/order_3.vue'], resolve),
            meta: { 
              title: '待评价订单'
            },
          },
          {
            path: '/order_3/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '待评价订单详情'
            },
          },
          {
            path: '/order_4',
            component: resolve => require(['@/components/page/order/order_4.vue'], resolve),
            meta: { 
              title: '已完成订单'
            },
          },
          {
            path: '/order_4/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '已完成订单详情'
            },
          },
          {
            path: '/order_5',
            component: resolve => require(['@/components/page/order/order_5.vue'], resolve),
            meta: { 
               title: '已取消订单'
            },
          },
          {
            path: '/order_5/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
              title: '已取消订单详情'
            },
          },
          {
            path: '/order_6',
            component: resolve => require(['@/components/page/order/order_6.vue'], resolve),
            meta: { 
               title: '已退款订单'
            },
          },
          {
            path: '/order_6/order_detail/:id',
            component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
            meta: { 
               title: '已退款订单详情'
            },
          },
          {
            path: '/allOrder',
            component: resolve => require(['@/components/page/order/allOrder.vue'], resolve),
            meta: { 
               title: '全部订单'
            },
          },
          // {
          //   path: '/allOrder/order_detail/:id/:status',
          //   component: resolve => require(['@/components/page/order/order_detail.vue'], resolve),
          //   meta: { 
          //      title: '全部订单详情'
          //   },
          // },
          {
            path:'/site/add_site',
            component:resolve => require(['@/components/page/add/addsite.vue'], resolve),
            meta:{
              title:'新增站点'
            }
          },
          {
            path:'/site/edit_site/:id',
            component:resolve => require(['@/components/page/add/addsite.vue'], resolve),
            meta:{
              title:'编辑站点'
            }
          },
          {
            path:'/site/detail_site/:id',
            component:resolve => require(['@/components/page/add/addsite.vue'], resolve),
            meta:{
              title:'站点详情'
            }
          },
          {
            path: '/waybill_0',
            component: resolve => require(['@/components/page/waybill/waybill_0.vue'], resolve),
            meta: { 
              title: '待分配运单'
            },
          },
          {
            path: '/waybill_1',
            component: resolve => require(['@/components/page/waybill/waybill_1.vue'], resolve),
            meta: { 
              title: '待分配配送单'
            },
          },
          {
            path: '/waybill_2',
            component: resolve => require(['@/components/page/waybill/waybill_2.vue'], resolve),
            meta: { 
              title: '已分配配送单'
            },
          },
          {
            path: '/banner',
            component: resolve => require(['@/components/page/banner.vue'], resolve),
            meta: { 
              title: 'banner管理'
            },
          },
          {
            path: '/banner/addBanner',
            component: resolve => require(['@/components/page/add/addBanner.vue'], resolve),
            meta: { 
              title: '新增banner'
            },
          },
          {
            path: '/banner/update_banner/:id',
            component: resolve => require(['@/components/page/add/addBanner.vue'], resolve),
            meta: { 
              title: '修改banner'
            },
          },
          {
            path: '/banner/detail_banner/:id',
            component: resolve => require(['@/components/page/add/addBanner.vue'], resolve),
            meta: { 
              title: 'banner详情'
            },
          },
          {
            path: '/service_famer',
            component: resolve => require(['@/components/page/content/service_famer.vue'], resolve),
            meta: { 
              title: '养殖户服务条款'
            },
          },
          {
            path: '/service_merchant',
            component: resolve => require(['@/components/page/content/service_merchant.vue'], resolve),
            meta: { 
              title: '商户服务条款'
            },
          },
          {
            path:'/about',
            component: resolve => require(['@/components/page/content/about_us.vue'], resolve),
            meta:{
              title:'关于我们'
            }
          },
          {
            path:'/treaty',
            component: resolve => require(['@/components/page/content/treaty.vue'], resolve),
            meta:{
              title:'供应端发布条约'
            }
          },
          {
            path: '/basecontent',
            component: resolve => require(['@/components/page/content/basecontent.vue'], resolve),
            meta: { 
              title: '商户服务条款'
            },
          },
          {
            path: '/params',
            component: resolve => require(['@/components/page/params.vue'], resolve),
            meta: { 
              title: '参数设置'
            },
          },
          {
            path: '/logistics',
            component: resolve => require(['@/components/page/system/logistics.vue'], resolve),
            meta: { 
              title: '参数设置'
            },
          },
          {
            path: '/syslog',
            component: resolve => require(['@/components/page/syslog.vue'], resolve),
            meta: { 
              title: '系统日志'
            },
          },
          {
            path: '/trade',
            component: resolve => require(['@/components/page/trade/trade.vue'], resolve),
            meta: { 
              title: '交易列表'
            },
          },
          {
            path: '/trade/trade_detail/:id',
            component: resolve => require(['@/components/page/trade/trade_detail.vue'], resolve),
            meta: { 
              title: '交易详情'
            },
          },
          {
            path: '/withdraw',
            component: resolve => require(['@/components/page/trade/withdraw.vue'], resolve),
            meta: { 
              title: '提现列表'
            },
          },
          {
            path: '/withdraw/withdraw_detail/:id',
            component: resolve => require(['@/components/page/trade/withdraw_detail.vue'], resolve),
            meta: { 
              title: '提现详情'
            },
          },
          {
            path: '/approveCount',
            component: resolve => require(['@/components/page/approveCount.vue'], resolve),
            meta: { 
              title: '认证统计'
            },
          },
          {
            path: '/feeCount',
            component: resolve => require(['@/components/page/feeCount.vue'], resolve),
            meta: { 
              title: '服务费统计'
            },
          },
          {
            path: '/orderCount',
            component: resolve => require(['@/components/page/add/orderCount.vue'], resolve),
            meta: { 
              title: '订单统计'
            },
          },
          {
            path: '/orderCount/orderWatch/:id/:date',
            component: resolve => require(['@/components/page/add/orderWatch.vue'], resolve),
            meta: { 
              title: '查看订单统计'
            },
          },
          {
            path: '/BD',
            component: resolve => require(['@/components/page/BD/BD.vue'], resolve),
            meta: { 
              title: '系统首页'
            },
          }
      ]
    }
  ]
})
